//
//  TWbHomeTimeLine.m
//  TencentWB
//
//  Created by kong_jinbiao on 14-5-15.
//  Copyright (c) 2014年 user. All rights reserved.
//

#import "TWbHomeTimeLine.h"
#import "TWbWeiboModel.h"
/**
 *  <#Description#>
 */
@implementation TWbHomeTimeLineInput

-(instancetype)init
{
    self = [super init];
    if(self)
    {
        self.m_action = TWB_STATUSES_HOMETIMELINE;
        self.m_responseClass = [TWbHomeTimeLineOutput class];
    }
    return self;
}

-(NSMutableDictionary *)paramsDicForGetRequest
{
    NSMutableDictionary *dic = [super paramsDicForGetRequest];
    [dic setValue:self.m_pageflag forKey:@"pageflag"];
    [dic setValue:self.m_pagetime forKey:@"pagetime"];
    [dic setValue:self.m_reqnum forKey:@"reqnum"];
    [dic setValue:self.m_type forKey:@"type"];
    [dic setValue:self.m_contenttype forKey:@"contenttype"];

    return dic;
}
@end


/**
 *  <#Description#>
 */
@implementation TWbHomeTimeLineOutput

-(void)parseDataWithDic:(NSMutableDictionary *)dic
{
    [super parseDataWithDic:dic];
    self.m_timeStamp = [[dic valueForKeyPath:@"data"] valueForKeyPath:@"timestamp"];
    self.m_hasNext = [[dic valueForKeyPath:@"data"] valueForKeyPath:@"hasnext"];
    NSArray *tmpOriginalDataArr = [[dic valueForKeyPath:@"data"] valueForKeyPath:@"info"];
    NSMutableArray *tmpDataArr = [NSMutableArray array];
    for(NSDictionary *dic in tmpOriginalDataArr)
    {
        TWbWeiboModel *weiboModel = [[TWbWeiboModel alloc]initWithDic:dic];
        [tmpDataArr addObject:weiboModel];
    }
    self.m_dataArr = tmpDataArr;
}

@end